package com.zbkj.common.sms;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @Auther:
 * @Date: 2024/9/11 18:53
 * @Description:
 */
@Slf4j
@Configuration
@ConditionalOnProperty(name="smsali.enabled", havingValue = "true")
public class AliSmsConfig {

    @Autowired
    private AliSmsProperties aliSmsProperties;

    @PostConstruct
    public void smsAliInit() {
        AliSmsUtil.aliSmsProperties = aliSmsProperties;
        AliSmsUtil.smsClientInit();
        log.info("阿里云sms服务初始化end");
    }
}
